package com.zhentao.controller;

import com.zhentao.model.admin.dto.LoginDto;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.AdUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v1/admin")
@Api(tags = "AdminController-后台管理登录")
public class AdminController {
    @Resource
    AdUserService userService;

    /**
     * 登录方法
     * @param dto
     * @return
     */
    @ApiOperation("登录方法")
    @PostMapping("/login")
    public ResponseResult login(@RequestBody LoginDto dto){
        return userService.login(dto);
    }
}
